/*    */ package com.wgcloud.util;
/*    */ 
/*    */ import java.io.IOException;
/*    */ import java.io.InputStream;
/*    */ import java.util.Properties;
/*    */ import java.util.Set;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class PropertyUtil
/*    */ {
/*    */   public static Set<String> getKeys(String fileName) {
/* 19 */     ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
/* 20 */     InputStream in = classLoader.getResourceAsStream(fileName);
/* 21 */     Properties p = new Properties();
/* 22 */     Set<String> keySet = null;
/*    */     try {
/* 24 */       p.load(in);
/* 25 */       keySet = p.stringPropertyNames();
/* 26 */       in.close();
/* 27 */     } catch (IOException e) {
/* 28 */       e.printStackTrace();
/*    */     } 
/* 30 */     return keySet;
/*    */   }
/*    */ 
/*    */   
/*    */   public static String get(String fileName, String propertyName) {
/* 35 */     ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
/* 36 */     InputStream in = classLoader.getResourceAsStream(fileName);
/* 37 */     Properties p = new Properties();
/* 38 */     String msg = "";
/*    */     try {
/* 40 */       p.load(in);
/* 41 */       msg = (String)p.get(propertyName);
/* 42 */       in.close();
/* 43 */     } catch (IOException e) {
/* 44 */       e.printStackTrace();
/*    */     } 
/* 46 */     return msg;
/*    */   }
/*    */ }


/* Location:              /Users/zhangyongxin/soft-install/wgcloud/wgcloud-v3.3.5/server/bank/wgcloud-server-release.jar!/BOOT-INF/classes/com/wgcloud/util/PropertyUtil.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */